<?php

class postTable extends Doctrine_Table
{
	
	public static function getInstance()
	{
		return Doctrine_Core::getTable('post');
	}
	
	function getTopic($topic_id)
	{
		return $this->createQuery()->innerJoin('post.user u')->where('post.id = ?', $topic_id)->fetchOne(array (), Doctrine_Core::HYDRATE_RECORD);
	}
	
	function mainPage()
	{
		return $this->createQuery()->leftJoin('post.user_last ul')->innerJoin('post.user u');
	}
}